<h1>EDI Native API</h1>
<a name="Extensions"></a><h1>Extensions</h1>
  <table class="apiIndex" title="Extensions">
<tr class="apiDef">
<td class="apiName"><a href="#group___edi" class="nameRef">Edi</a></td>
<td class="apiBrief">Database structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_field" class="nameRef">EdiField</a></td>
<td class="apiBrief">EDI Record field structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_grid" class="nameRef">EdiGrid</a></td>
<td class="apiBrief">Grid structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_rec" class="nameRef">EdiRec</a></td>
<td class="apiBrief">Database record structure.</td></tr>
<tr class="apiDef">
<td class="apiName"><a href="#group___edi_service" class="nameRef">EdiService</a></td>
<td class="apiBrief">Edi service control structure.</td></tr>
</table>
<a name="Functions"></a><h1>Functions</h1>
  <table class="apiIndex" title="Functions">
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gafac7f959a214551acc56fd42a8c0e04e" class="nameRef">edRemoveColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Remove a column from a table.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gab66595c455e15000e812ec830acce7d9" class="nameRef">ediAddColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a column to a table.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga81c6f760f0e529fb91868fc2caddcec8" class="nameRef">ediAddFieldError</a>(struct EdiRec *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *field, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a field error message.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaa6413f84f22899c4ae15e8ac3f477f56" class="nameRef">ediAddIndex</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add an index to a table.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga7c605c7761d7a46a207cb6dd0f71b372" class="nameRef">ediAddProvider</a>(struct EdiProvider *provider)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a database provider.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gad0cad6a7fe8e2568923e47d6e9085ed4" class="nameRef">ediAddTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a table to a database.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga64cb0410a70843250c9826e8d12e3944" class="nameRef">ediAddValidation</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#osdep_8h_1a5272042f7e0f5c53e2fd4b49ff47d92d" class="ref">cvoid</a> *data)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Add a validation.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaf35d7f7eba6e1ea718e0169987807f61" class="nameRef">ediChangeColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Change a column schema definition.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi" class="ref">Edi*</a></td><td><a href="#group___edi_1gaed4dfcec9716bc48818a51b446921bd6" class="nameRef">ediClone</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Clone a database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1gaa2607091f3a16d14643c675405556ebd" class="nameRef">ediCloneGrid</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Clone a grid.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga81b2c711a2a3047672b6c259946be394" class="nameRef">ediClose</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Close a database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1ga7500efee354868a347e7a9cc763994af" class="nameRef">ediCreateBareGrid</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nrows)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a bare grid.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1ga15bf63cd0ba27fd41ffcd2556552bc9c" class="nameRef">ediCreateBareRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nfields)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a bare record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1gad4e706a1a2d9ff527c9d42612ebeeae1" class="nameRef">ediCreateRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_service" class="ref">EdiService*</a></td><td><a href="#group___edi_service_1ga52bb6b4d64beebfacefa8cc7cfeab50f" class="nameRef">ediCreateService</a>()</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create the EDI service.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga789f616e9f38aee34d6862bf85ac4742" class="nameRef">ediDefineMigration</a>(struct Edi *edi, <a href="#edi_8h_1af52ffce789628c7454d22c76cf56d380" class="ref">EdiMigration</a> forw, <a href="#edi_8h_1af52ffce789628c7454d22c76cf56d380" class="ref">EdiMigration</a> back)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Define migration callbacks.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_service_1ga889df64bdd239f71c66b4fa920be8f46" class="nameRef">ediDefineValidation</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="#group___edi_service_1ga3cf21d57a02f250570e2beafc05befd9" class="ref">EdiValidationProc</a> vfn)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Define a field validation procedure.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaec3079929130e2f517f56d8c322e2468" class="nameRef">ediDelete</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Delete the database at the given path.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_grid_1ga0b5c39ab9aa8d6cba06403659aa9e36b" class="nameRef">ediFilterGridFields</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Filter the fields of a grid.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_rec_1ga72056f840f501082ef3efac4c4454e24" class="nameRef">ediFilterRecFields</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Filter the fields of a record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_1ga64d2d436610342310b2b4a7dae4ed376" class="nameRef">ediFormatField</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="#group___edi_field" class="ref">EdiField</a> *fp)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Format a field value.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gac764d3271d738b2e6d284e4d49e8b90e" class="nameRef">ediGetColumnSchema</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int *type, int *flags, int *cid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the column schema.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_list" class="ref">MprList*</a></td><td><a href="#group___edi_1gab5db5e05416c9998e8b3f3a2e700c2a2" class="nameRef">ediGetColumns</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a list of column names.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_field" class="ref">EdiField*</a></td><td><a href="#group___edi_1ga8c63c2630f7052b17422ff1c15cc85d6" class="nameRef">ediGetField</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a record field.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga1f563dfa6f4ad87a227f0470b2a9838e" class="nameRef">ediGetFieldType</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the data type of a record field.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_1gaa232690d3f51e8ee058aed2f294c2f6c" class="nameRef">ediGetFieldValue</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a field value.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_list" class="ref">MprList*</a></td><td><a href="#group___edi_1ga573eb5891e0dfbe37febd3fa93c469ad" class="nameRef">ediGetGridColumns</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a list of grid column names.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_grid_1gaec44a7575ea84f98f8a6a89d88d67df0" class="nameRef">ediGetGridSchemaAsJson</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the schema for a grid and format as JSON.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_field" class="ref">EdiField*</a></td><td><a href="#group___edi_rec_1gad8a96a0785fa3cfd81f99eb75c02bbee" class="nameRef">ediGetNextField</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="#group___edi_field" class="ref">EdiField</a> *fp, int offset)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the next field in a record This is used as an iterator.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_grid_1ga4ea5088bc3e4cc1206310bc46236bb03" class="nameRef">ediGetNextRec</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the next record in a grid This is used as an iterator.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#struct_mpr_hash" class="ref">MprHash*</a></td><td><a href="#group___edi_1ga653dfa35de74e1c3049b3ba9191215e0" class="nameRef">ediGetRecErrors</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get record validation errors.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_rec_1ga1320e35f4abcbfd440c8122a0e1d9e10" class="nameRef">ediGetRecSchemaAsJson</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get the schema for a record and format as JSON.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga159e08f49d49361fd64b40e5df18b644" class="nameRef">ediGetTableDimensions</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int *numRows, int *numCols)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get table dimensions information.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_1ga8f0843a106c7b705f2f7b462aa4857a5" class="nameRef">ediGetTableSchemaAsJson</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a table schema and format as JSON.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_list" class="ref">MprList*</a></td><td><a href="#group___edi_1gafe0368e00f99402ec33a3058fb8aec00" class="nameRef">ediGetTables</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Get a list of database tables.</td></tr>
<tr class="apiDef"><td class="apiType">char*</td><td><a href="#group___edi_1ga39664fad5ac6b8e8d4392e1b6196c668" class="nameRef">ediGetTypeString</a>(int type)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Convert an EDI type to a string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_1gaf649c3a40366fd45bf7999d34aa3d893" class="nameRef">ediGridAsJson</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Convert an EDI database grid into a JSON string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1ga64b3d4293374b0c0ebeb7aa4a8729ccd" class="nameRef">ediJoin</a>(<a href="#group___edi" class="ref">Edi</a> *edi, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Join grids.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga7dec1de01e90319b1ff0fe351f83f49e" class="nameRef">ediLoad</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Load the database file.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaa88adbb2470a05da45d468fd9d578672" class="nameRef">ediLookupField</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Lookup a column field by name.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#struct_edi_provider" class="ref">EdiProvider*</a></td><td><a href="#group___edi_1ga042cf084b2e3c1487644cdf7f9a0257d" class="nameRef">ediLookupProvider</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *providerName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Lookup an EDI provider name.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1ga92df88662a9be066b5e3eff35b8954b1" class="nameRef">ediMakeGrid</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a grid.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#struct_mpr_hash" class="ref">MprHash*</a></td><td><a href="#group___edi_1gac8ba9b4a0cdc2d2f30de7d915a4c51c1" class="nameRef">ediMakeHash</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a hash container of property values.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="mpr.html#group___mpr_json" class="ref">MprJson*</a></td><td><a href="#group___edi_1ga5ed0a53407a3c91bc90c7d05d8ed7144" class="nameRef">ediMakeJson</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a JSON container of property values.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1ga5bf685fd34ebd962218f900361ada49b" class="nameRef">ediMakeRec</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Make a record.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga6913a7aa47c80857de9057e5442b5834" class="nameRef">ediManageEdiRec</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Manage an EdiRec instance for garbage collection.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi" class="ref">Edi*</a></td><td><a href="#group___edi_1ga7c923cfc31d2c7d94c9338c7849b8da6" class="nameRef">ediOpen</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *source, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *provider, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Open a database.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga9e890e5216c6c01220e6ba150197a0e1" class="nameRef">ediParseTypeString</a>(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *type)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Parse an EDI type string.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_grid_1gab083046f341a40f3880e0dc41a6f2845" class="nameRef">ediPivotGrid</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Pivot a grid swapping rows for columns.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1ga26a2a774e3058ebbce96b515d1aaf6b4" class="nameRef">ediQuery</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *cmd, int argc, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> **argv, va_list vargs)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Run a query.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_field" class="ref">EdiField</a></td><td><a href="#group___edi_1gafe7cfc471e3df12dcd88b28ff01a958d" class="nameRef">ediReadField</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a field from the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_1gad06ac586c4ad7316e3d72043b6e52151" class="nameRef">ediReadFieldValue</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *defaultValue)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a formatted field from the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1ga9da339eccd0e7dddfea03640bfa30e7f" class="nameRef">ediReadRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1ga6aa80d0b9c1ac033017529a67d76bfc0" class="nameRef">ediReadRecWhere</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *operation, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read one record.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1ga05bd6c0bc6cb6d7bd01550de2843b099" class="nameRef">ediReadTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read a table.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_grid" class="ref">EdiGrid*</a></td><td><a href="#group___edi_1gaff88b5fa67778c33a447fbb231a928c1" class="nameRef">ediReadWhere</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *operation, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Read matching records.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar*</a></td><td><a href="#group___edi_1gafa8c8e27f4ec96f66948f31d40ad95d6" class="nameRef">ediRecAsJson</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Convert an EDI database record into a JSON string.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga2e0e7c2d3e5c286a51bdc7c1d18cc34b" class="nameRef">ediRemoveIndex</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Remove a table index.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gaaa5333b9b756b1d362d9803830ec3f50" class="nameRef">ediRemoveRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Delete a row in a database table.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1gae965f0739fa618a75fdc0455453dec14" class="nameRef">ediRemoveTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Remove a table from the database.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga6725ef26c5e502c45ed03f42c2f75051" class="nameRef">ediRenameColumn</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newColumnName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Rename a column.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga42ebae84b96f934005926c25cb568f24" class="nameRef">ediRenameTable</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newTableName)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Rename a table.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga77d616667577833662154d65ef794519" class="nameRef">ediSave</a>(<a href="#group___edi" class="ref">Edi</a> *edi)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Save in-memory database contents to disk.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1ga649f5d198bed950955c34c05d8b59777" class="nameRef">ediSetField</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Set a record field without writing to the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="#group___edi_rec" class="ref">EdiRec*</a></td><td><a href="#group___edi_1ga916af8d529a028643e87b3b8c8973a85" class="nameRef">ediSetFields</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *data)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Set record fields without writing to the database.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga8a81197882a1574b7bd5a89dd725d238" class="nameRef">ediSetPrivate</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1ad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Create a private database for each client.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga04c6635bccb8f8c2a1b2d5e3bad74bd3" class="nameRef">ediSetReadonly</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1ad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Control whether the database accepts updates.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga14dfc03675a9312facb1be7dd48f73d6" class="nameRef">ediUpdateField</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Write a value to a database table field.</td></tr>
<tr class="apiDef"><td class="apiType">int</td><td><a href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa" class="nameRef">ediUpdateRec</a>(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Write a record to the database.</td></tr>
<tr class="apiDef"><td class="apiType"><a href="osdep.html#osdep_8h_1ad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a></td><td><a href="#group___edi_1ga7525ab6e695b51abc1bb342b8f35022b" class="nameRef">ediValidateRec</a>(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Validate a record.</td></tr>
<tr class="apiDef"><td class="apiType">void</td><td><a href="#group___edi_1ga18375a1455d10df65a92b6adc3409830" class="nameRef">espDumpGrid</a>(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)</td></tr><tr class="apiBrief"><td>&nbsp;</td><td>Display the grid to the debug log.</td></tr>
</table>
<a name="Typedefs"></a><h1>Typedefs</h1>
<table class="apiIndex" title="typedefs">
<tr class="apiDef"><td class="apiName"><a href="#struct_edi_provider" class="nameRef">EdiProvider</a></td><td class="apiBrief">Database provider interface.</td></tr>
<tr class="apiDef"><td class="apiName"><a href="#struct_edi_validation" class="nameRef">EdiValidation</a></td><td class="apiBrief">Validation structure.</td></tr>
<tr class="apiDef"><td class="apiName"><a href="#group___edi_service_1ga3cf21d57a02f250570e2beafc05befd9" class="nameRef">EdiValidationProc</a></td><td class="apiBrief">Field validation callback procedure.</td></tr>
</table>
<a name="Defines"></a><h1>Defines</h1>
<table class="apiIndex" title="Defines">
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a84cefff441de0de7ef30a78e55150c1a" class="nameRef">EDI_AUTO_INC</a>&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Automatic increments on new row.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a0fc3c13863bc64f832d0524825eaccec" class="nameRef">EDI_AUTO_SAVE</a>&nbsp;&nbsp;&nbsp;0x2</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Auto-save database if modified in memory.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a12ef9df56bd504e09c8466345a3f8f2c" class="nameRef">EDI_CREATE</a>&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Create database if not present.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a26eb47bd03dbe38d487bfbe714eb8f45" class="nameRef">EDI_FOREIGN</a>&nbsp;&nbsp;&nbsp;0x8</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column is a foreign key.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1af4b1c5417043e83de7e12253173c4b32" class="nameRef">EDI_GRID_READ_ONLY</a>&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Grid contains pure database records, must not be modified.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1aa250b5270a6712a110ad52fb6de2e943" class="nameRef">EDI_INDEX</a>&nbsp;&nbsp;&nbsp;0x4</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column is indexed.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a14387cca6628803c8ef36dde843d6859" class="nameRef">EDI_KEY</a>&nbsp;&nbsp;&nbsp;0x2</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column is the ID key.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a39aeab0f683f28577c0069b7fde2425a" class="nameRef">EDI_LITERAL</a>&nbsp;&nbsp;&nbsp;0x8</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Literal schema in ediOpen source parameter.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a83428eb53ed4c3e10521b459df263308" class="nameRef">EDI_NO_SAVE</a>&nbsp;&nbsp;&nbsp;0x4</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Prevent saving to disk.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1af1eaf78875be29a2bf00cf732dec04ea" class="nameRef">EDI_NOT_NULL</a>&nbsp;&nbsp;&nbsp;0x10</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Field flag <ndash/> Column must not be null (not implemented).</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a8e7cad2b406b0d2b1306fcf646703faa" class="nameRef">EDI_PRIVATE</a>&nbsp;&nbsp;&nbsp;0x20</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Create private clone of the database.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a288a24bd0787d029ff45d5ff524be9d5" class="nameRef">EDI_SUPPRESS_SAVE</a>&nbsp;&nbsp;&nbsp;0x10</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Temporarily suppress auto-save.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a746df6a6802b08fe4947b35244dba71c" class="nameRef">EDI_TYPE_BINARY</a>&nbsp;&nbsp;&nbsp;1</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Arbitrary binary data.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a77bdc2d051ab90c28efe5e4ba1cceb2c" class="nameRef">EDI_TYPE_BOOL</a>&nbsp;&nbsp;&nbsp;2</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Boolean true|false value.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a7fc2ab5751a3baca9319cfd53875f9d6" class="nameRef">EDI_TYPE_DATE</a>&nbsp;&nbsp;&nbsp;3</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Date type.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a2870a18f02348419a26169dbf0ebf409" class="nameRef">EDI_TYPE_FLOAT</a>&nbsp;&nbsp;&nbsp;4</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Floating point number.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a2d1f6f789e2bf18e8ea956932b2dbff0" class="nameRef">EDI_TYPE_INT</a>&nbsp;&nbsp;&nbsp;5</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Integer number.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a68172d98d38832146258813c3db750d1" class="nameRef">EDI_TYPE_MAX</a>&nbsp;&nbsp;&nbsp;8</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Max type + 1.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1adaf7fc17c98589a64fd985cebcef3f00" class="nameRef">EDI_TYPE_STRING</a>&nbsp;&nbsp;&nbsp;6</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>String.</td></tr>
<tr class="apiDef">
<td>#define</td><td><a href="#edi_8h_1a472cde49406f5a25cd201576622a4781" class="nameRef">EDI_TYPE_TEXT</a>&nbsp;&nbsp;&nbsp;7</td>
</tr>
<tr class="apiBrief"><td>&nbsp;</td><td>Multi-line text.</td></tr>
  </table>
<h1>Edi</h1>
<a name="group___edi"></a>
<div class="api">
  <div class="prototype">Edi</div>
  <div class="apiDetail">
<p>Database structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>The Embedded Database Interface (EDI) defines an abstract interface atop various relational database providers. Providers are supplied for SQLite and for the ESP Memory Database (MDB).</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">EdiMigration</td><td><td>back</td><td>
Backward migration callback.
</td>
    <tr><td class="param">char *</td><td><td>errMsg</td><td>
Last error message.
</td>
    <tr><td class="param">int</td><td><td>flags</td><td>
Database flags.
</td>
    <tr><td class="param">EdiMigration</td><td><td>forw</td><td>
Forward migration callback.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_mutex" external="mpr.dtags">MprMutex</a> *</td><td><td>mutex</td><td>
Multithread lock.
</td>
    <tr><td class="param">cchar *</td><td><td>path</td><td>
Database path.
</td>
    <tr><td class="param">struct <a class="ref" href="#struct_edi_provider">EdiProvider</a> *</td><td><td>provider</td><td>
Database provider.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_hash" external="mpr.dtags">MprHash</a> *</td><td><td>schemaCache</td><td>
Cache of table schema in JSON.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_hash" external="mpr.dtags">MprHash</a> *</td><td><td>validations</td><td>
Validations.
</td>
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_1gab66595c455e15000e812ec830acce7d9"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)
  </div>
  <div class="apiDetail">
<p>Add a column to a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">type</td><td>Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</td>
    <tr><td class="param">flags</td><td>Control column attributes. Set to a set of: EDI_AUTO_INC for auto incrementing columns, EDI_KEY if the column is the key column and/or EDI_INDEX to create an index on the column.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaa6413f84f22899c4ae15e8ac3f477f56"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddIndex
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)
  </div>
  <div class="apiDetail">
<p>Add an index to a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">indexName</td><td>Ignored. Set to null.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gad0cad6a7fe8e2568923e47d6e9085ed4"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Add a table to a database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name. Table names should be singular. Certain routines like ediJoin rely on being able to map foreign key fields of the form NameId by converting the Name to a database table.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga64cb0410a70843250c9826e8d12e3944"></a>
<div class="api">
  <div class="prototype">
    int
    ediAddValidation
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#osdep_8h_1a5272042f7e0f5c53e2fd4b49ff47d92d" class="ref">cvoid</a> *data)
  </div>
  <div class="apiDetail">
<p>Add a validation.</p>
    <dl><dt><b>Description</b>:</dt><dd>Validations are run when calling ediUpdateRec. A validation is used to validate field data using builtin validators.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">name</td><td>Validation name. Select from: <ul><li>banned <ndash/> to validate field data against a regular express for banned content. </li><li>boolean <ndash/> to validate field data as &quot;true&quot; or &quot;false&quot; </li><li>date <ndash/> to validate field data as a date or time. </li><li>format <ndash/> to validate field data against a regular expression supplied in the &quot;data&quot; argument </li><li>integer <ndash/> to validate field data as an integral value </li><li>number <ndash/> to validate field data as a number. It may be an integer or floating point number. </li><li>present <ndash/> to validate field data as not null. </li><li>unique <ndash/> to validate field data as being unique in the database table. </li></ul></td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">data</td><td>Argument data for the validator. For example: the &quot;format&quot; validator requires a regular expression.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaf35d7f7eba6e1ea718e0169987807f61"></a>
<div class="api">
  <div class="prototype">
    int
    ediChangeColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int type, int flags)
  </div>
  <div class="apiDetail">
<p>Change a column schema definition.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">type</td><td>Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</td>
    <tr><td class="param">flags</td><td>Control column attributes. Set to a set of: EDI_AUTO_INC for auto incrementing columns, EDI_KEY if the column is the key column and/or EDI_INDEX to create an index on the column.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaed4dfcec9716bc48818a51b446921bd6"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi" class="ref">Edi</a> *
    ediClone
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Clone a database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database to clone.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A copy of the database.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaa2607091f3a16d14643c675405556ebd"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediCloneGrid
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Clone a grid.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>to clone.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A complete copy of a grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga81b2c711a2a3047672b6c259946be394"></a>
<div class="api">
  <div class="prototype">
    void
    ediClose
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Close a database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga7500efee354868a347e7a9cc763994af"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediCreateBareGrid
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nrows)
  </div>
  <div class="apiDetail">
<p>Create a bare grid.</p>
    <dl><dt><b>Description</b>:</dt><dd>This creates an empty grid based on the given table&apos;s schema.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">nrows</td><td>Number of rows to reserve in the grid.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>EdiGrid instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga15bf63cd0ba27fd41ffcd2556552bc9c"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediCreateBareRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int nfields)
  </div>
  <div class="apiDetail">
<p>Create a bare record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This creates an empty record based on the given table&apos;s schema.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">nfields</td><td>Number of fields to reserve in the record.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>EdiGrid instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gad4e706a1a2d9ff527c9d42612ebeeae1"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediCreateRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Create a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This will create a record using the given database tableName to supply the record schema. Use <a class="ref" href="#group___edi_1ga15bf63cd0ba27fd41ffcd2556552bc9c">ediCreateBareRec</a> to create a free-standing record without requiring a database. The record is allocated and room is reserved to store record values. No record field values are stored.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Record instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaec3079929130e2f517f56d8c322e2468"></a>
<div class="api">
  <div class="prototype">
    int
    ediDelete
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)
  </div>
  <div class="apiDetail">
<p>Delete the database at the given path.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle. This is required to identify the database provider. The database should be closed before deleting.</td>
    <tr><td class="param">path</td><td>Database path name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga64d2d436610342310b2b4a7dae4ed376"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediFormatField
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="#group___edi_field" class="ref">EdiField</a> *fp)
  </div>
  <div class="apiDetail">
<p>Format a field value.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">fmt</td><td>Printf style format string.</td>
    <tr><td class="param">fp</td><td>Field whoes value will be formatted.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Formatted value string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gab5db5e05416c9998e8b3f3a2e700c2a2"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_list" class="ref">MprList</a> *
    ediGetColumns
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Get a list of column names.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An MprList of column names in the given table.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gac764d3271d738b2e6d284e4d49e8b90e"></a>
<div class="api">
  <div class="prototype">
    int
    ediGetColumnSchema
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, int *type, int *flags, int *cid)
  </div>
  <div class="apiDetail">
<p>Get the column schema.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">type</td><td>Output parameter to receive the column data type. Will be set to one of: EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT. Set to null if this data is not required.</td>
    <tr><td class="param">flags</td><td>Output parameter to receive the column control flags. Will be set to one or more of: EDI_AUTO_INC, EDI_KEY and/or EDI_INDEX Set to null if this data is not required.</td>
    <tr><td class="param">cid</td><td>Output parameter to receive the ordinal column index in the database table. Set to null if this data is not required.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga8c63c2630f7052b17422ff1c15cc85d6"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_field" class="ref">EdiField</a> *
    ediGetField
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Get a record field.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Database record.</td>
    <tr><td class="param">fieldName</td><td>Field in the record to extract.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An EdiField structure containing the record field value and details.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga1f563dfa6f4ad87a227f0470b2a9838e"></a>
<div class="api">
  <div class="prototype">
    int
    ediGetFieldType
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Get the data type of a record field.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to examine.</td>
    <tr><td class="param">fieldName</td><td>Field to examine.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The field type. Returns one of: EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaa232690d3f51e8ee058aed2f294c2f6c"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediGetFieldValue
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Get a field value.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Database record.</td>
    <tr><td class="param">fieldName</td><td>Field in the record to extract.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A field value as a string. Returns ZZ.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga573eb5891e0dfbe37febd3fa93c469ad"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_list" class="ref">MprList</a> *
    ediGetGridColumns
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Get a list of grid column names.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Database grid.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An MprList of column names in the given grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga653dfa35de74e1c3049b3ba9191215e0"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#struct_mpr_hash" class="ref">MprHash</a> *
    ediGetRecErrors
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Get record validation errors.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Database record.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A hash of validation errors. If validation passed, then this call returns NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga159e08f49d49361fd64b40e5df18b644"></a>
<div class="api">
  <div class="prototype">
    int
    ediGetTableDimensions
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, int *numRows, int *numCols)
  </div>
  <div class="apiDetail">
<p>Get table dimensions information.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">numRows</td><td>Output parameter to receive the number of rows in the table Set to null if this data is not required.</td>
    <tr><td class="param">numCols</td><td>Output parameter to receive the number of columns in the table Set to null if this data is not required.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gafe0368e00f99402ec33a3058fb8aec00"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_list" class="ref">MprList</a> *
    ediGetTables
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Get a list of database tables.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An MprList of table names in the database.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga8f0843a106c7b705f2f7b462aa4857a5"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediGetTableSchemaAsJson
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Get a table schema and format as JSON.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Name of table to examine.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga39664fad5ac6b8e8d4392e1b6196c668"></a>
<div class="api">
  <div class="prototype">
    char *
    ediGetTypeString
(int type)
  </div>
  <div class="apiDetail">
<p>Convert an EDI type to a string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">type</td><td>Column data type. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Type string. This will be set to one of: &quot;binary&quot;, &quot;bool&quot;, &quot;date&quot;, &quot;float&quot;, &quot;int&quot;, &quot;string&quot; or &quot;text&quot;.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaf649c3a40366fd45bf7999d34aa3d893"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediGridAsJson
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)
  </div>
  <div class="apiDetail">
<p>Convert an EDI database grid into a JSON string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>EDI grid.</td>
    <tr><td class="param">flags</td><td>Reserved. Set to zero.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>JSON string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga64b3d4293374b0c0ebeb7aa4a8729ccd"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediJoin
(<a href="#group___edi" class="ref">Edi</a> *edi, ...)
  </div>
  <div class="apiDetail">
<p>Join grids.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">...</td><td>Null terminated list of data grids. These are instances of EdiGrid.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A joined grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga7dec1de01e90319b1ff0fe351f83f49e"></a>
<div class="api">
  <div class="prototype">
    int
    ediLoad
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *path)
  </div>
  <div class="apiDetail">
<p>Load the database file.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">path</td><td>Database path name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaa88adbb2470a05da45d468fd9d578672"></a>
<div class="api">
  <div class="prototype">
    int
    ediLookupField
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Lookup a column field by name.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">fieldName</td><td>Database column field name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The ordinal column index in the table if the column field is found. Otherwise returns a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga042cf084b2e3c1487644cdf7f9a0257d"></a>
<div class="api">
  <div class="prototype">
    <a href="#struct_edi_provider" class="ref">EdiProvider</a> *
    ediLookupProvider
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *providerName)
  </div>
  <div class="apiDetail">
<p>Lookup an EDI provider name.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">providerName</td><td>Name of the EDI provider.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The EDI provider object. Returns null if the provider cannot be found.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga92df88662a9be066b5e3eff35b8954b1"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediMakeGrid
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)
  </div>
  <div class="apiDetail">
<p>Make a grid.</p>
\par \b Description:
This call makes a free-standing data grid based on the JSON format content string
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">content</td><td>JSON format content string. The content should be an array of objects where each object is a set of property names and values.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An EdiGrid instance.</dd></dl>
    <dl><dt><b>Example</b>:</dt><dd>: grid = ediMakeGrid("[ \ <br/>
 { id: &apos;1&apos;, country: &apos;Australia&apos; }, \ <br/>
 { id: &apos;2&apos;, country: &apos;China&apos; }, \ <br/>
 ]");.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gac8ba9b4a0cdc2d2f30de7d915a4c51c1"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#struct_mpr_hash" class="ref">MprHash</a> *
    ediMakeHash
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Make a hash container of property values.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine formats the given arguments, parses the result as a JSON string and returns an equivalent hash of property values.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">fmt</td><td>Printf style format string.</td>
    <tr><td class="param">...</td><td>arguments.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd><a class="ref" href="#struct_mpr_hash" external="mpr.dtags">MprHash</a> instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga5ed0a53407a3c91bc90c7d05d8ed7144"></a>
<div class="api">
  <div class="prototype">
    <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *
    ediMakeJson
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Make a JSON container of property values.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine formats the given arguments, parses the result into a JSON object.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">fmt</td><td>Printf style format string.</td>
    <tr><td class="param">...</td><td>arguments.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>MprJson instance.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga5bf685fd34ebd962218f900361ada49b"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediMakeRec
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *content)
  </div>
  <div class="apiDetail">
<p>Make a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This call makes a free-standing data record based on the JSON format content string.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">content</td><td>JSON format content string. The content should be a set of property names and values.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>An EdiRec instance.</dd></dl>
    <dl><dt><b>Example</b>:</dt><dd>: rec = ediMakeRec(&quot;{ id: 1, title: &apos;Message One&apos;, body: &apos;Line one&apos; }&quot;);.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga6913a7aa47c80857de9057e5442b5834"></a>
<div class="api">
  <div class="prototype">
    void
    ediManageEdiRec
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)
  </div>
  <div class="apiDetail">
<p>Manage an EdiRec instance for garbage collection.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record instance.</td>
    <tr><td class="param">flags</td><td>GC management flag.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga7c923cfc31d2c7d94c9338c7849b8da6"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi" class="ref">Edi</a> *
    ediOpen
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *source, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *provider, int flags)
  </div>
  <div class="apiDetail">
<p>Open a database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This opens a database using the specified database provider.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">source</td><td>Database path name. If using the &quot;mdb&quot; provider with the EDI_LITERAL flag, then the source argument can be set to a literal JSON database content string.</td>
    <tr><td class="param">provider</td><td>Database provider. Set to &quot;mdb&quot; for the Memory Database or &quot;sqlite&quot; for the SQLite provider.</td>
    <tr><td class="param">flags</td><td>Set to: <ul><li>EDI_CREATE <ndash/> Create database if not present. </li><li>EDI_AUTO_SAVE <ndash/> Auto-save database if modified in memory. This option is only supported by the &quot;mdb&quot; provider. </li><li>EDI_NO_SAVE <ndash/> Prevent saving to disk. This option is only supported by the &quot;mdb&quot; provider. </li><li>EDI_LITERAL <ndash/> Literal schema in ediOpen source parameter. This option is only supported by the &quot;mdb&quot; provider. </li></ul></td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>If successful, returns an EDI database instance object. Otherwise returns zero.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga9e890e5216c6c01220e6ba150197a0e1"></a>
<div class="api">
  <div class="prototype">
    int
    ediParseTypeString
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *type)
  </div>
  <div class="apiDetail">
<p>Parse an EDI type string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">type</td><td>Type string set to one of: &quot;binary&quot;, &quot;bool&quot;, &quot;date&quot;, &quot;float&quot;, &quot;int&quot;, &quot;string&quot; or &quot;text&quot;.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Type code. Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE, EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga26a2a774e3058ebbce96b515d1aaf6b4"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediQuery
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *cmd, int argc, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> **argv, va_list vargs)
  </div>
  <div class="apiDetail">
<p>Run a query.</p>
    <dl><dt><b>Description</b>:</dt><dd>This runs a provider dependant query. For the SDB SQLite provider, this runs an SQL statement. The &quot;mdb&quot; provider does not implement this API. To do queries using the &quot;mdb&quot; provider, use: <a class="ref" href="#group___edi_1ga9da339eccd0e7dddfea03640bfa30e7f">ediReadRec</a>, <a class="ref" href="#group___edi_1ga6aa80d0b9c1ac033017529a67d76bfc0">ediReadRecWhere</a>, <a class="ref" href="#group___edi_1gaff88b5fa67778c33a447fbb231a928c1">ediReadWhere</a>, <a class="ref" href="#group___edi_1gafe7cfc471e3df12dcd88b28ff01a958d">ediReadField</a> and <a class="ref" href="#group___edi_1ga05bd6c0bc6cb6d7bd01550de2843b099">ediReadTable</a>. The query may contain positional parameters via argc/argv or via a va_list. These are recommended to mitigate SQL injection risk.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">cmd</td><td>Query command to execute.</td>
    <tr><td class="param">argc</td><td>Number of query parameters in argv.</td>
    <tr><td class="param">argv</td><td>Query parameter arguments.</td>
    <tr><td class="param">vargs</td><td>Query parameters supplied in a NULL terminated va_list.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>If succesful, returns tabular data in the form of an EgiGrid structure. Returns NULL on errors.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gafe7cfc471e3df12dcd88b28ff01a958d"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_field" class="ref">EdiField</a>
    ediReadField
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName)
  </div>
  <div class="apiDetail">
<p>Read a field from the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This reads a field from the database.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Row key column value to read.</td>
    <tr><td class="param">fieldName</td><td>Column name to read.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Field value or null if the no record is found. May return null or empty if the field is null or empty.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gad06ac586c4ad7316e3d72043b6e52151"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediReadFieldValue
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *defaultValue)
  </div>
  <div class="apiDetail">
<p>Read a formatted field from the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This reads a field from the database and formats the result using an optional format string. If the field has a null or empty value, the supplied defaultValue will be returned.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">fmt</td><td>Reserved. Set to NULL.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Row key column value to read.</td>
    <tr><td class="param">fieldName</td><td>Column name to read.</td>
    <tr><td class="param">defaultValue</td><td>Default value to return if the field is null or empty.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Field value or default value if field is null or empty. Returns null if no matching record is found.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga9da339eccd0e7dddfea03640bfa30e7f"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediReadRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)
  </div>
  <div class="apiDetail">
<p>Read a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>Read a record from the given table as identified by the key value.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Key value of the record to read.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Record instance of EdiRec.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga6aa80d0b9c1ac033017529a67d76bfc0"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediReadRecWhere
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *operation, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)
  </div>
  <div class="apiDetail">
<p>Read one record.</p>
    <dl><dt><b>Description</b>:</dt><dd>This runs a simple query on the database and selects the first matching record. The query selects a row that has a &quot;field&quot; that matches the given &quot;value&quot;.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">fieldName</td><td>Database field name to evaluate.</td>
    <tr><td class="param">operation</td><td>Comparision operation. Set to &quot;==&quot;, &quot;!=&quot;, &quot;&lt;&quot;, &quot;&gt;&quot;, &quot;&lt;=&quot; or &quot;&gt;=&quot;.</td>
    <tr><td class="param">value</td><td>Data value to compare with the field values.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>First matching record. Returns NULL if no matching records.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga05bd6c0bc6cb6d7bd01550de2843b099"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediReadTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Read a table.</p>
    <dl><dt><b>Description</b>:</dt><dd>This reads all the records in a table and returns a grid containing the results.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A grid containing all records in the table. Returns NULL if no matching records.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaff88b5fa67778c33a447fbb231a928c1"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediReadWhere
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *operation, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)
  </div>
  <div class="apiDetail">
<p>Read matching records.</p>
    <dl><dt><b>Description</b>:</dt><dd>This runs a simple query on the database and returns matching records in a grid. The query selects all rows that have a &quot;field&quot; that matches the given &quot;value&quot;.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">fieldName</td><td>Database field name to evaluate.</td>
    <tr><td class="param">operation</td><td>Comparision operation. Set to &quot;==&quot;, &quot;!=&quot;, &quot;&lt;&quot;, &quot;&gt;&quot;, &quot;&lt;=&quot; or &quot;&gt;=&quot;.</td>
    <tr><td class="param">value</td><td>Data value to compare with the field values.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>A grid containing all matching records. Returns NULL if no matching records.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gafa8c8e27f4ec96f66948f31d40ad95d6"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediRecAsJson
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, int flags)
  </div>
  <div class="apiDetail">
<p>Convert an EDI database record into a JSON string.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>EDI record.</td>
    <tr><td class="param">flags</td><td>Reserved. Set to zero.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>JSON string.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga2e0e7c2d3e5c286a51bdc7c1d18cc34b"></a>
<div class="api">
  <div class="prototype">
    int
    ediRemoveIndex
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *indexName)
  </div>
  <div class="apiDetail">
<p>Remove a table index.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">indexName</td><td>Ignored. Set to null. This call will remove the table index.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gaaa5333b9b756b1d362d9803830ec3f50"></a>
<div class="api">
  <div class="prototype">
    int
    ediRemoveRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key)
  </div>
  <div class="apiDetail">
<p>Delete a row in a database table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Row key column value to delete.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gae965f0739fa618a75fdc0455453dec14"></a>
<div class="api">
  <div class="prototype">
    int
    ediRemoveTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName)
  </div>
  <div class="apiDetail">
<p>Remove a table from the database.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga6725ef26c5e502c45ed03f42c2f75051"></a>
<div class="api">
  <div class="prototype">
    int
    ediRenameColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newColumnName)
  </div>
  <div class="apiDetail">
<p>Rename a column.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    <tr><td class="param">newColumnName</td><td>New column name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga42ebae84b96f934005926c25cb568f24"></a>
<div class="api">
  <div class="prototype">
    int
    ediRenameTable
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *newTableName)
  </div>
  <div class="apiDetail">
<p>Rename a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">newTableName</td><td>New database table name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga77d616667577833662154d65ef794519"></a>
<div class="api">
  <div class="prototype">
    int
    ediSave
(<a href="#group___edi" class="ref">Edi</a> *edi)
  </div>
  <div class="apiDetail">
<p>Save in-memory database contents to disk.</p>
    <dl><dt><b>Description</b>:</dt><dd>How this call behaves is provider dependant. If the provider is &quot;mdb&quot; and the database is not opened with AutoSave, then this call will save the in-memory contents. If the &quot;mdb&quot; database is opened with AutoSave, then this call will do nothing. For the &quot;sdb&quot; SQLite provider, this call does nothing.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga649f5d198bed950955c34c05d8b59777"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediSetField
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)
  </div>
  <div class="apiDetail">
<p>Set a record field without writing to the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine updates the record object with the given value. The record will not be written to the database. To write to the database, use <a class="ref" href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa">ediUpdateRec</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">fieldName</td><td>Record field name to update.</td>
    <tr><td class="param">value</td><td>Value to update.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The record instance if successful, otherwise NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga916af8d529a028643e87b3b8c8973a85"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediSetFields
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="mpr.html#group___mpr_json" class="ref">MprJson</a> *data)
  </div>
  <div class="apiDetail">
<p>Set record fields without writing to the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>This routine updates the record object with the given values. The "data&apos; argument supplies a hash of fieldNames and values. The data hash may come from the request params() or it can be manually created via <a class="ref" href="#group___edi_1gac8ba9b4a0cdc2d2f30de7d915a4c51c1">ediMakeHash</a> to convert a JSON string into an options hash. For example: ediSetFields(rec, mprParseJson(&quot;{ name: &apos;%s&apos;, address: &apos;%s&apos; }&quot;, name, address)) The record will not be written to the database. To write to the database, use <a class="ref" href="#group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa">ediUpdateRec</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">data</td><td>Json object of field to use for the update.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The record instance if successful, otherwise NULL.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga8a81197882a1574b7bd5a89dd725d238"></a>
<div class="api">
  <div class="prototype">
    void
    ediSetPrivate
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1ad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)
  </div>
  <div class="apiDetail">
<p>Create a private database for each client.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">on</td><td>Set to true to clone the database for each connected client.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga04c6635bccb8f8c2a1b2d5e3bad74bd3"></a>
<div class="api">
  <div class="prototype">
    void
    ediSetReadonly
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1ad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a> on)
  </div>
  <div class="apiDetail">
<p>Control whether the database accepts updates.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">on</td><td>Set to true to make the database readonly, i.e. to disable all updates.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga14dfc03675a9312facb1be7dd48f73d6"></a>
<div class="api">
  <div class="prototype">
    int
    ediUpdateField
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *key, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fieldName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *value)
  </div>
  <div class="apiDetail">
<p>Write a value to a database table field.</p>
    <dl><dt><b>Description</b>:</dt><dd>Update the value of a table field in the selected table row. Note: field validations are not run.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">key</td><td>Key value for the table row to update.</td>
    <tr><td class="param">fieldName</td><td>Column name to update.</td>
    <tr><td class="param">value</td><td>Value to write to the database field.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga9b65a775c4ddc081e49b1a55cabc06aa"></a>
<div class="api">
  <div class="prototype">
    int
    ediUpdateRec
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Write a record to the database.</p>
    <dl><dt><b>Description</b>:</dt><dd>If the record is a new record and the &quot;id&quot; column is EDI_AUTO_INC, then the &quot;id&quot; will be assigned prior to saving the record.</dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">rec</td><td>Record to write to the database.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga7525ab6e695b51abc1bb342b8f35022b"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1ad5c9d4ba3dc37783a528b0925dc981a0" class="ref">bool</a>
    ediValidateRec
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Validate a record.</p>
    <dl><dt><b>Description</b>:</dt><dd>Run defined field validations and return true if the record validates. Field validations are defined via <a class="ref" href="#group___edi_1ga64cb0410a70843250c9826e8d12e3944">ediAddValidation</a> calls. If any validations fail, error messages will be added to the record and can be retrieved via <a class="ref" href="#group___edi_1ga653dfa35de74e1c3049b3ba9191215e0">ediGetRecErrors</a></dd></dl>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to validate.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>True if all field valiations pass.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1gafac7f959a214551acc56fd42a8c0e04e"></a>
<div class="api">
  <div class="prototype">
    int
    edRemoveColumn
(<a href="#group___edi" class="ref">Edi</a> *edi, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *tableName, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *columnName)
  </div>
  <div class="apiDetail">
<p>Remove a column from a table.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">tableName</td><td>Database table name.</td>
    <tr><td class="param">columnName</td><td>Database column name.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>Zero if successful. Otherwise a negative MPR error code.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_1ga18375a1455d10df65a92b6adc3409830"></a>
<div class="api">
  <div class="prototype">
    void
    espDumpGrid
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Display the grid to the debug log.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>EDI grid.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<h1>EdiField</h1>
<a name="group___edi_field"></a>
<div class="api">
  <div class="prototype">EdiField</div>
  <div class="apiDetail">
<p>EDI Record field structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>The EdiField stores record field data and minimal schema information such as the data type and source column name.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">int</td><td><td>flags</td><td>
Field flags. 
Flag mask set to EDI_AUTO_INC, EDI_KEY and/or EDI_INDEX.
</td>
    <tr><td class="param">cchar *</td><td><td>name</td><td>
Field name. 
Sourced from the database column name.
</td>
    <tr><td class="param">int</td><td><td>type</td><td>
Field data type. 
Set to one of EDI_TYPE_BINARY, EDI_TYPE_BOOL, EDI_TYPE_DATE EDI_TYPE_FLOAT, EDI_TYPE_INT, EDI_TYPE_STRING, EDI_TYPE_TEXT.
</td>
    <tr><td class="param">int</td><td><td>valid</td><td>
Field validity. 
Set to true if valid.
</td>
    <tr><td class="param">cchar *</td><td><td>value</td><td>
Field data value.
</td>
    </table></dd></dl>
  </div>
</div>
<h1>EdiGrid</h1>
<a name="group___edi_grid"></a>
<div class="api">
  <div class="prototype">EdiGrid</div>
  <div class="apiDetail">
<p>Grid structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>A grid is a tabular (grid) of rows and records. Grids may capture database table data, or may be free-standing without a backing database.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">struct Edi *</td><td><td>edi</td><td>
Database handle.
</td>
    <tr><td class="param">int</td><td><td>flags</td><td>
Grid flags.
</td>
    <tr><td class="param">int</td><td><td>nrecords</td><td>
Number of records in grid.
</td>
    <tr><td class="param">EdiRec *</td><td><td>records[ARRAY_FLEX]</td><td>
Grid records.
</td>
    <tr><td class="param">cchar *</td><td><td>tableName</td><td>
Base table name for grid.
</td>
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_grid_1ga0b5c39ab9aa8d6cba06403659aa9e36b"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediFilterGridFields
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)
  </div>
  <div class="apiDetail">
<p>Filter the fields of a grid.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Grid to modify and filter.</td>
    <tr><td class="param">fields</td><td>Space separated list of record field names.</td>
    <tr><td class="param">include</td><td>Set to true to interpret the names as fields to include. If false, interpret the names as fields to reject.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The filtered grid. Same reference as the input grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_grid_1gaec44a7575ea84f98f8a6a89d88d67df0"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediGetGridSchemaAsJson
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid)
  </div>
  <div class="apiDetail">
<p>Get the schema for a grid and format as JSON.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Grid to examine.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_grid_1ga4ea5088bc3e4cc1206310bc46236bb03"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediGetNextRec
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, <a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Get the next record in a grid This is used as an iterator.</p>
For the first call, set rec to NULL
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Grid whose records are iterated.</td>
    <tr><td class="param">rec</td><td>Record pointer.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The next record object. Returns NULL after the last record.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_grid_1gab083046f341a40f3880e0dc41a6f2845"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_grid" class="ref">EdiGrid</a> *
    ediPivotGrid
(<a href="#group___edi_grid" class="ref">EdiGrid</a> *grid, int flags)
  </div>
  <div class="apiDetail">
<p>Pivot a grid swapping rows for columns.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">grid</td><td>Source grid.</td>
    <tr><td class="param">flags</td><td>Control flags. Set to EDI_PIVOT_FIELD_NAMES to use field names as the first column of data.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>New pivoted grid.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<h1>EdiRec</h1>
<a name="group___edi_rec"></a>
<div class="api">
  <div class="prototype">EdiRec</div>
  <div class="apiDetail">
<p>Database record structure.</p>
    <dl><dt><b>Description</b>:</dt><dd>Records may capture database row data, or may be free-standing without a backing database.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">struct Edi *</td><td><td>edi</td><td>
Database handle.
</td>
    <tr><td class="param"><a class="ref" href="#struct_mpr_hash" external="mpr.dtags">MprHash</a> *</td><td><td>errors</td><td>
Hash of record errors.
</td>
    <tr><td class="param">EdiField</td><td><td>fields[ARRAY_FLEX]</td><td>
Field records.
</td>
    <tr><td class="param">cchar *</td><td><td>id</td><td>
Record key ID.
</td>
    <tr><td class="param">int</td><td><td>index</td><td>
Grid index for iteration.
</td>
    <tr><td class="param">int</td><td><td>nfields</td><td>
Number of fields in record.
</td>
    <tr><td class="param">cchar *</td><td><td>tableName</td><td>
Base table name for record.
</td>
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_rec_1ga72056f840f501082ef3efac4c4454e24"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_rec" class="ref">EdiRec</a> *
    ediFilterRecFields
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fields, int include)
  </div>
  <div class="apiDetail">
<p>Filter the fields of a record.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to modify and filter.</td>
    <tr><td class="param">fields</td><td>Space separated list of record field names.</td>
    <tr><td class="param">include</td><td>Set to true to interpret the names as fields to include. If false, interpret the names as fields to reject.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The filtered record. Same reference as the input record.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Internal.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_rec_1gad8a96a0785fa3cfd81f99eb75c02bbee"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_field" class="ref">EdiField</a> *
    ediGetNextField
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec, <a href="#group___edi_field" class="ref">EdiField</a> *fp, int offset)
  </div>
  <div class="apiDetail">
<p>Get the next field in a record This is used as an iterator.</p>
For the first call, set fp to NULL
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record whose fields are iterated.</td>
    <tr><td class="param">fp</td><td>Field pointer.</td>
    <tr><td class="param">offset</td><td>Initial offset. Set to 1 to step over the ID field.</td>
    </table></dd></dl>
    <dl><dt>Returns:</dt><dd>The next field object. Returns NULL after the last field.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_rec_1ga1320e35f4abcbfd440c8122a0e1d9e10"></a>
<div class="api">
  <div class="prototype">
    <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *
    ediGetRecSchemaAsJson
(<a href="#group___edi_rec" class="ref">EdiRec</a> *rec)
  </div>
  <div class="apiDetail">
<p>Get the schema for a record and format as JSON.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td></td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<h1>EdiService</h1>
<a name="group___edi_service"></a>
<div class="api">
  <div class="prototype">EdiService</div>
  <div class="apiDetail">
<p>Edi service control structure.</p>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    </table></dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga81c6f760f0e529fb91868fc2caddcec8"></a>
<div class="api">
  <div class="prototype">
    void
    ediAddFieldError
(struct EdiRec *rec, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *field, <a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *fmt, ...)
  </div>
  <div class="apiDetail">
<p>Add a field error message.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">rec</td><td>Record to update.</td>
    <tr><td class="param">field</td><td>Field name for the error message.</td>
    <tr><td class="param">fmt</td><td>Message format string.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Prototype.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga7c605c7761d7a46a207cb6dd0f71b372"></a>
<div class="api">
  <div class="prototype">
    void
    ediAddProvider
(struct EdiProvider *provider)
  </div>
  <div class="apiDetail">
<p>Add a database provider.</p>
    <dl><dt><b>Description</b>:</dt><dd>This should only be called by database providers.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga52bb6b4d64beebfacefa8cc7cfeab50f"></a>
<div class="api">
  <div class="prototype">
    <a href="#group___edi_service" class="ref">EdiService</a> *
    ediCreateService
()
  </div>
  <div class="apiDetail">
<p>Create the EDI service.</p>
    <dl><dt>Returns:</dt><dd>EdiService object.</dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga789f616e9f38aee34d6862bf85ac4742"></a>
<div class="api">
  <div class="prototype">
    void
    ediDefineMigration
(struct Edi *edi, <a href="#edi_8h_1af52ffce789628c7454d22c76cf56d380" class="ref">EdiMigration</a> forw, <a href="#edi_8h_1af52ffce789628c7454d22c76cf56d380" class="ref">EdiMigration</a> back)
  </div>
  <div class="apiDetail">
<p>Define migration callbacks.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">edi</td><td>Database handle.</td>
    <tr><td class="param">forw</td><td>Forward migration callback. Of the form: int forw(Edi *edit); A successful return should be zero.</td>
    <tr><td class="param">back</td><td>Backward migration callback. Of the form: int back(Edi *edit); A successful return should be zero.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="group___edi_service_1ga889df64bdd239f71c66b4fa920be8f46"></a>
<div class="api">
  <div class="prototype">
    void
    ediDefineValidation
(<a href="osdep.html#osdep_8h_1a0f128c3e0c83721af0220c00554e9c4e" class="ref">cchar</a> *name, <a href="#group___edi_service_1ga3cf21d57a02f250570e2beafc05befd9" class="ref">EdiValidationProc</a> vfn)
  </div>
  <div class="apiDetail">
<p>Define a field validation procedure.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">name</td><td>Validation name.</td>
    <tr><td class="param">vfn</td><td>Validation callback to invoke when validating field data.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<h2>Functions</h2>
<h2>Typedefs</h2>
<a name="group___edi_service_1ga3cf21d57a02f250570e2beafc05befd9"></a>
<div class="api">
  <div class="prototype">
    typedef cchar*(* EdiValidationProc)(struct EdiValidation *vp, struct EdiRec *rec, cchar *fieldName, cchar *value).
  </div>
  <div class="apiDetail">
<p>Field validation callback procedure.</p>
    <dl><dt>Parameters:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">vp</td><td>Validation structure reference.</td>
    <tr><td class="param">rec</td><td>Record to validate.</td>
    <tr><td class="param">fieldName</td><td>Field name to validate.</td>
    <tr><td class="param">value</td><td>Field value to validate.</td>
    </table></dd></dl>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>See Also:</dt><dd>
    </dd></dl>
  </div>
</div>
<a name="struct_edi_provider"></a>
<div class="api">
  <div class="prototype">EdiProvider</div>
  <div class="apiDetail">
<p>Database provider interface.</p>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    </table></dd></dl>
  </div>
</div>
<a name="struct_edi_validation"></a>
<div class="api">
  <div class="prototype">EdiValidation</div>
  <div class="apiDetail">
<p>Validation structure.</p>
    <dl><dt><b>API</b> Stability:</dt><dd>Evolving.</dd></dl>
    <dl><dt>Fields:</dt><dd>
    <table class="parameters" title="Parameters">
    <tr><td class="param">cvoid *</td><td><td>data</td><td>
Custom data (managed).
</td>
    <tr><td class="param">cvoid *</td><td><td>mdata</td><td>
Custom data (unmanaged).
</td>
    <tr><td class="param">cchar *</td><td><td>name</td><td>
Validation name.
</td>
    <tr><td class="param"><a class="ref" href="#group___edi_service_1ga3cf21d57a02f250570e2beafc05befd9">EdiValidationProc</a></td><td><td>vfn</td><td>
Validation callback procedure.
</td>
    </table></dd></dl>
  </div>
</div>
